package com.fzb.forum4j.po;

import java.io.File;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Transient;

import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.LazyToOne;
import org.hibernate.annotations.LazyToOneOption;
import org.hibernate.annotations.Parameter;
@Entity
public class UserDetails {

	@Transient
	private File header;
	
	private String headerFileName;
	@Transient
	private String headerContentType;
	
	
	private String homePage;

	private String title;

	private String alias;

	private String phone;
	

	private String template;

	private Integer icon;

	private Integer integral;

	public String getHomePage() {
		return homePage;
	}

	public void setHomePage(String homePage) {
		this.homePage = homePage;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getAlias() {
		return alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getTemplate() {
		return template;
	}

	public void setTemplate(String template) {
		this.template = template;
	}

	 

	public Integer getIntegral() {
		return integral;
	}

	public void setIntegral(Integer integral) {
		this.integral = integral;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Integer getIcon() {
		return icon;
	}

	public void setIcon(Integer icon) {
		this.icon = icon;
	}
 
	public File getHeader(){
		return header;
	}
	public void setHeader(File header) {
		this.header = header;
	}
	public String getHeaderFileName() {
		return headerFileName;
	}

	public void setHeaderFileName(String headerFileName) {
		this.headerFileName = headerFileName;
	}
	public String getHeaderContentType() {
		return headerContentType;
	}
	
	public void setHeaderContentType(String headerContentType) {
		this.headerContentType = headerContentType;
	}
 
 

	public void setUserId(Integer userId) {
		System.out.println(userId);
		this.userId =userId;
	}

	public Integer getUserId() {
		return userId;
	}



	@Id
	@GeneratedValue(generator="user_details")
	@GenericGenerator(name="user_details",parameters={
			@Parameter(name = "property", value = "user")
	},strategy="foreign")
	private Integer userId;
	
	@OneToOne
	@LazyToOne(LazyToOneOption.FALSE)
	@PrimaryKeyJoinColumn(name="userId")
	private User user;

}
